package com.woniu.job.service.impl;

import com.woniu.job.entity.Resume;
import com.woniu.job.mapper.ResumeMapper;
import com.woniu.job.service.IResumeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * 性别：m 男     f  女
 * 婚姻状态： y 已婚    n  未婚    s  保密
 * 简历状态： 1 已发布  2 未发表  3 通过审核  4 未通审核  5 假删除
 * </p>
 *
 * @author song
 * @since 2019-12-24
 */
@Transactional
@Service
public class ResumeServiceImpl extends ServiceImpl<ResumeMapper, Resume> implements IResumeService {

    @Resource
    private ResumeMapper resumeMapper;

    @Override
    public boolean save(Resume resume) {
        int rows = resumeMapper.insert(resume);
        boolean status = true;
        if (rows == 0) {
            status = false;
        }
        return status;
    }

    @Override
    public List<Resume> getResumes() {
        return resumeMapper.selectList(null);
    }

    @Override
    public List<Resume> selectByMap(Map<String, Object> columnMap) {
        return resumeMapper.selectByMap(columnMap);
    }

    @Override
    public void deleteById(String id) {
        resumeMapper.deleteById(id);
    }

    @Override
    public Resume getResumeById(String id) {
        return resumeMapper.getResumeById(id);
    }

}
